<template>
  <div class="va-container">
    <div class="textarea-con" :class="{'validate-err': errors.has('personalResume')}" style="margin-bottom: 10px;">
      <label data-content="个人履历*">个人履历*&nbsp;&nbsp;&nbsp;<span class="lg-promp">不超过600字</span></label>
      <textarea rows="3" class="width-full" v-model="otherInfo.personalResume" v-validate="'required|min:1|max:600'" name="personalResume"></textarea>
    </div>
    <!-- 上传附件 -->
    <div class="flex-row vip-upload">
      <label data-content="上传附件">上传附件</label>
      <!-- attachment 附件资料-->
      <file-upload
        ref="upload"
        :file-list="fileList"
        v-model="otherInfo.attachment"
        v-validate="'required|fileupload'"
        name="attachment"
      >
        <el-button slot="trigger" class="width-200">选取文件</el-button>
        <span slot="tip" class="el-upload__tip">最多上传8个文件，每个不超过15M,支持扩展名：.zip .doc .docx .pdf .jpg .xls .xlsx .png....</span>
      </file-upload>
    </div>
    <div class="tc">
      <!-- <el-button type="success width-200" plain round>保存草稿</el-button> -->
      <!-- <el-button type="success width-100" plain round>打印</el-button> -->
      <el-button type="success width-100" plain round @click="priview()">预览</el-button>
      <el-button type="success width-200" round @click="confirm()">提交申请</el-button>
    </div>
  </div>
</template>

<script>
// import { getAuthorization } from '../login/autologin'
  export default {
    title: '个人其他信息',
    name: 'person-other-info',
    data () {
      return {
        otherInfo: {},
        fileList: []
      }
    },
    props: {
      data: {}
    },
    methods: {
      // 预览
      priview () {
        this.$emit('priview')
      },
      confirm () {
        this.$emit('comfirm')
      },
      validate () {
        return this.$validator.validateAll()
      },
    },
    mounted () {
      this.otherInfo = Object.assign({}, this.data)
      this.setInit()
    },
    watch: {
      'otherInfo': {
        handler: function (val, oldVal) {
          this.$emit('update:data', this.otherInfo)
        },
        deep: true
      }
    }
  }
</script>
<style scoped>
  .duigou-con {
    margin-left: 12px;
  }
  .vip-upload * {
    font-size: 16px;
    color: #666666;
  }
  .vip-upload > * + * {
    margin-left: 12px;
  }
  .vip-upload > div {
    padding-bottom: 20px;
  }
</style>
